home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 19
/
Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso
/
Aminet
/
comm
/
bbs
/
FList_211.lha
/
FList
/
Bonus
/
AmNSpam.Rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-03-14
|
6KB
|
165 lines
/**/
/* Am N' Spam - (C) S.Gillibrand 1996 - Digital Design Production */
/* */
/* Usage: */
/* */
/* amnspam [cd device] [output path] [default access] [default flags] */
/* cd0: file:cd/aminet/ 10 -------- */
/* */
/**/
options failat 50
say 'H'
say 'Am N'' Spam - (c) S.Gillibrand 1996 - Digital Design Production'
say 'FList CD [Aminet] List compiler!'
say ''
arg cddev' 'topath' 'defacc' 'deflag
if compress(cddev)=""|compress(cddev)="?" then do
say 'amnspam [cd device] [output path] [default access] [default flags]'
say ' cd0: file:cd/aminet/ 10 -------- '
say ''
exit
end
if right(topath,1)='/' then topath=left(topath,length(topath)-1)
address command 'info 'cddev' >ram:cdinf'
call open(cdinf,'ram:cdinf','r')
do 3;dummy=readln(cdinf);end
volnam=substr(readln(cdinf),53)':'
call close(cdinf)
say 'Building directory information from ['cddev']...'
dte="961219"
if ~open(inc,cddev'aminet/tree','r') then do
say 'There is NO Aminet CD located in the device ['cddev']!'
say ''
exit
end
series=substr(volnam,7,length(volnam)-7)
say 'Detected Aminet Series 'series
do 2;say '';end
topath=topath||series
if ~exists(topath) then address command 'makedir "'topath'" >NIL:'
if ~exists(topath) then do
say 'ACannot access or create ['topath']!'
say ''
exit
end
topath=topath'/'
call open(acfgo,topath'_areas.cfg','w')
call open(_acfgo,topath'__areas.cfg','w')
call writeln(_acfgo,'#')
call writeln(_acfgo,'# FList CDRom Areas Config')
call writeln(_acfgo,'# The Syntax Is As Follows...')
call writeln(_acfgo,'#')
call writeln(_acfgo,'# The First Line Is The Number Of Areas You Have.')
call writeln(_acfgo,'#')
call writeln(_acfgo,'# The Name Of The Area As You Wish It To Appear Inside FList')
call writeln(_acfgo,'# The Path To The List Of Files (As Generated By An External FList Cd Compiler)')
call writeln(_acfgo,'# [Optional] The Global Path To Where All The Files In The List Area Are Located.')
call writeln(_acfgo,'# The Minimum Access Level Required To Access The Area.')
call writeln(_acfgo,'# The Minimum Flags Required To Access The Area.')
call writeln(_acfgo,'#')
call open(rams,'ram:sjit','w')
areas=0
do until eof(inc)
data=readln(inc)
if pos('/',left(data,12))=0|pos('info/',left(data,12))>0 then iterate
if compress(data)="" then iterate
areas=areas+1
dir=compress(left(data,12))
say 'AStoring & Creating from ['dir']...'
desc.dir=right(data,length(data)-13)
call writeln(rams,dir)
if ~exists(topath||dir) then do
golp=left(dir,pos('/',dir)-1)
if ~exists(topath||golp) then address command 'makedir "'topath||golp'" >NIL:'
address command 'makedir "'topath||dir'" >NIL:'
end
end
call close(inc)
call close(rams)
say ''
say '['areas'] areas found.'
say ''
say 'Adding CDRom information to BBS:Configs/FList.CDROM...'
if ~open(flcdr,'bbs:configs/flist.cdrom','a') then do
call open(flcdr,'bbs:configs/flist.cdrom','w')
call writeln(flcdr,'#')
call writeln(flcdr,'# FList CDRom Config File')
call writeln(flcdr,'#')
call writeln(flcdr,'# The Syntax Is As Follows:')
call writeln(flcdr,'#')
call writeln(flcdr,'# The Full Title Of The Cd As You Want It To Appear In FList.')
call writeln(flcdr,'# The Device Name For The Cd (DON''T USE CD0/1/2/etc.:!).')
call writeln(flcdr,'# The Path To The Config File For The Areas Of The CD-Rom.')
call writeln(flcdr,'# [Optional] Path To An ANSI File That Will Be Used Instead Of Listing Areas.')
call writeln(flcdr,'# Minimum Access Level Needed To Access This CDRom.')
call writeln(flcdr,'# Minimum Flag Requirements Needed To Access This CDRom.')
call writeln(flcdr,'#')
end
call writeln(flcdr,caseconvert(left(volnam,6))' 'left(right(volnam,3),2)' - Definitive collection of Amiga files')
call writeln(flcdr,volnam)
call writeln(flcdr,topath'Areas.Cfg')
call writeln(flcdr,'')
call writeln(flcdr,defacc)
call writeln(flcdr,deflag)
call close(flcdr)
say ''
say 'Compiling FList files.bbs format files...'
say ''
call open(In,'ram:sjit','r')
do until eof(in)
dir=readln(in)
if compress(Dir)="" then leave
mas=dir
dir=cddev'aminet/'dir
call writech(stdout,'AWorking on ['left(mas,12)']')
call writech(stdout,'.')
if ~open(ni,dir'/index','r') then do
say ': [NO INDEX FILE]'
say ''
areas=areas-1
end
else do
call writeln(acfgo,desc.mas)
call writeln(acfgo,topath||mas'/files.bbs')
call writeln(acfgo,volnam'aminet/'mas'/')
call writeln(acfgo,defacc)
call writeln(acfgo,deflag)
call writech(stdout,'.')
call open(Out,topath||mas'/files.bbs','w')
call writech(stdout,'.')
do until eof(ni)
data=readln(ni)
if eof(ni) then leave
if left(data,1)="|"|compress(data)="" then iterate
fnam=left(data,18)
fsiz=compress(substr(data,31,3))*1024
if substr(data,34,1)="M" then fsiz=left(fsiz,1)||right(fsiz,1)*102400
call writeln(out,left(fnam,23)' 'right(fsiz,7)' 'dte' 'right(data,length(data)-39))
end
call close(out)
say '.'
end
call close(ni)
end
call close(in)
call close(acfgo)
say ''
say 'Finished buttering!'
call writeln(_acfgo,areas)
call close(_acfgo)
address command 'join "'topath'__areas.cfg" "'topath'_areas.cfg" as="'topath'areas.cfg"'
address command 'delete "'topath'_areas.cfg'" quiet'
address command 'delete "'topath'__areas.cfg'" quiet'
say '['areas'] areas found containing valid INDEX files.'
say ''
exit
CaseConvert:
arg conv_str
conv_str=translate(CONV_STR,Xrange('a','z'),Xrange('A','Z')) ; tmp=''
do a=1 to words(CONV_STR)
tmp=tmp||upper(left(word(CONV_STR,A),1))substr(word(CONV_STR,A),2)' '
end
CONV_STR=left(tmp,length(tmp)-1)
return(CONV_STR)